<template>
  <div class="bread-crumb">
    <div class="crumb">
      <span class="current-local">当前位置 <i class="icon icon-right"></i></span>
      <el-breadcrumb separator-class="el-icon-d-arrow-right">
        <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
        <el-breadcrumb-item>
          <a v-if="index == 2" href="/category?id=1&index=2">电视剧</a>
          <a v-else href="/category?id=1&index=1">电影</a>
        </el-breadcrumb-item>
        <el-breadcrumb-item>{{title}}</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
  </div>
</template>

<script>
export default {
  name: 'BreadCrumb',
  props: {
    title: {
      type: String
    }
  },
  data () {
    return {
      index: 0
    }
  },
  created () {
    this.index = this.$route.query.index
  }
}
</script>

<style lang="scss" scoped>
.bread-crumb{
  .crumb{
    margin-top: 10px;
    border: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    height: 40px;
    line-height: 40px;
    .current-local{
      margin-right: 30px;
      padding: 0 20px;
      color: #484848;
      font-size: 14px;
      font-weight: bold;
      border-right: 1px solid #DEDEDE;
      background: #F6F7F6;
      position: relative;
      .icon{
        width: 12px;
        height: 12px;
        background: #F6F7F6;
        border-top: 1px solid #DEDEDE;
        border-right: 1px solid #DEDEDE;
        -webkit-box-sizing: border-box;
        box-sizing: border-box;
        -webkit-transform: rotateZ(45deg);
        transform: rotateZ(45deg);
        position: absolute;
        top: 35%;
        right: -7px;
      }
    }
  }
  >>>.el-breadcrumb__inner.is-link:hover,.el-breadcrumb__inner a:hover{
    color: #00A37C;
  }
}
</style>
